package com.accp.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.accp.pojo.Goods;
import com.accp.pojo.Income;
import com.accp.pojo.OrderInfo;
import com.accp.pojo.Room;
import com.accp.pojo.RoomType;
import com.accp.pojo.Vip;
@Repository("orderInfoMapper")
public interface OrderInfoMapper {
    int deleteByPrimaryKey(Integer orderid);

    int insert(OrderInfo record);

    int insertSelective(OrderInfo record);

    OrderInfo selectByPrimaryKey(Integer orderid);

    int updateByPrimaryKeySelective(OrderInfo record);

    int updateByPrimaryKey(OrderInfo record);
    //模糊查询加全部查询
    List<OrderInfo> getAllOrder(@Param("roomTypeId")Integer roomTypeId,@Param("jiezhang")Integer jiezhang,@Param("beginTime")String beginTime,@Param("overTime")String overTime,@Param("roomNum")Integer roomNum,@Param("user")String user);
    
    //查询房间类型用于模糊查询
    List<RoomType> getRoomType();
    
    //单个查询，用于详细信息
    OrderInfo getByOrderId(int id);
    
    //根据订单编号查询收入--前提已结账
    Income getIncomeByOrderId(Integer id);
    
    //全部物品查询
    List<Goods> getAllGoods();
    
    //结算时的修改，省略当前时间，物品列表
    void jiesuanorder(@Param("oid")Integer oid);
    
    //改变房间状态--
    void jeisuanroom(Integer roomid);
    void openroom(Integer roomid);
    
    //获取所有空房间
    List<Room> getallroom();
    
    //收入添加
    void addincome(@Param("oid")int oid,@Param("money")double money);
    
    //批量添加使用物品
    void addGoods(@Param("oid")int oid,@Param("gods")Integer [] gods);
    
    //获取身份表
    List<Vip> getVipAll();
    
    //添加新的订单表
    void neworder(@Param("orderid")Integer orderid,@Param("cardnum")String cardnum,@Param("roomid")Integer roomid);
    
    //residents住户添加
    void newResidents(@Param("cardnum")String cardnum,@Param("vipid")Integer vipid,@Param("name")String name);
    
    //判断住户是否存在
    int quertmanifexi(String cardnum);
}